# coding:utf-8

import tornado.web
import tornado.ioloop


class IndexHandler(tornado.web.RequestHandler):
    """请求处理类"""
    def get(self):
        """对应用户GET请求方式"""
        self.write("hello world!")

    def post(self):
        """对应用户POST请求方式"""
        self.write("hello wolrd!")


if __name__ == "__main__":
    app = tornado.web.Application(
        [(r"/", IndexHandler)]
    )
    # 服务器监听端口
    app.listen(8000)
    tornado.ioloop.IOLoop.current().start()
